import React, {Component} from 'react';
import styles from './index.less';
import classNames from 'classnames';
import {
  Pagination
} from 'antd';


export default class PageComponent extends Component {
  constructor(props) {

    //const style = this.props.style;

    super(props);
  }

  render() {
    let { className ,simple ,itemRender} =this.props;
    const classContent = classNames(styles.page, {
      [className]: className,
    })
    if ( !simple && !itemRender ){
      itemRender = (current, type, originalElement)=>{
        //console.log(type);
        if (type === 'prev') {
          return <a>{'<'}</a>;
        }
        if (type === 'next') {
          return <a>{'>'}</a>;
        }
        return originalElement;
      }
    }


    return <Pagination  {...this.props} itemRender={itemRender} className={classContent}  />;
  }
}
